package com.xgggh.redpack.domain.wallet;

import android.os.Parcel;
import android.os.Parcelable;

import androidx.databinding.BaseObservable;

public class Wallet extends BaseObservable implements Parcelable {
    private Long id;
    private Long accountId;
    private double amount;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getAccountId() {
        return accountId;
    }

    public void setAccountId(Long accountId) {
        this.accountId = accountId;
    }

    public double getAmount() {
        return amount;
    }

    public void setAmount(double amount) {
        this.amount = amount;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeValue(this.id);
        dest.writeValue(this.accountId);
        dest.writeDouble(this.amount);
    }

    public Wallet() {
    }

    protected Wallet(Parcel in) {
        this.id = (Long) in.readValue(Long.class.getClassLoader());
        this.accountId = (Long) in.readValue(Long.class.getClassLoader());
        this.amount = in.readDouble();
    }

    public static final Parcelable.Creator<Wallet> CREATOR = new Parcelable.Creator<Wallet>() {
        @Override
        public Wallet createFromParcel(Parcel source) {
            return new Wallet(source);
        }

        @Override
        public Wallet[] newArray(int size) {
            return new Wallet[size];
        }
    };
}
